﻿//2. Write a program to convert binary numbers to their decimal representation.


using System;
using System.Collections.Generic;

class BinaryToDecimal
{
    static void Main()
    {
        string binaryNumber = Console.ReadLine();
        Console.WriteLine(GetBinaryDecimalInt(binaryNumber));
    }
    static int GetBinaryDecimalInt(string binaryNumber)
    {
        int decimalNumber = 0;
        for (int i = 0; i < binaryNumber.Length; i++)
        {
            decimalNumber += (binaryNumber[i] - '0') * (int)Math.Pow(2, binaryNumber.Length - 1 - i);
        }
        return decimalNumber;
    }
}
